<template>
  <div class="container">
    <div class="container__content">
      <mailListSearch />

      <mail-list-banner :iconItems="mailListPatientIcon" />

      <div class="container__content__message">
        <div class="container__content__message__title">患者消息</div>
        <div class="container__content__message__msgPanel">
          <div class="container__content__message__msgPanel__header">
            <div
              class="container__content__message__msgPanel__header__one active"
            >
              消息
            </div>
            <div class="container__content__message__msgPanel__header__two">
              所有
            </div>
            <div class="container__content__message__msgPanel__header__three">
              分组
            </div>
            <div class="container__content__message__msgPanel__header__three">
              群聊
            </div>
            <div class="container__content__message__msgPanel__header__three">
              代填资料
            </div>
          </div>
          <div class="container__content__message__msgPanel__content">
            <div
              class="container__content__message__msgPanel__content__items"
              v-for="(item, index) of patientLinkManItem"
              :key="index"
              @click="toChat(item.username)"
            >
              <img
                :src="item.headImg"
                alt=""
                class="container__content__message__msgPanel__content__items__img"
              />
              <div
                class="container__content__message__msgPanel__content__items__right"
              >
                <div
                  class="container__content__message__msgPanel__content__items__right__top"
                >
                  {{ item.username }} <span class="type">{{ item.type }}</span>
                </div>
                <div
                  class="container__content__message__msgPanel__content__items__right__bottom"
                >
                  <div
                    class="container__content__message__msgPanel__content__items__right__bottom__left"
                  >
                    {{ item.msg }}
                  </div>
                  <div
                    class="container__content__message__msgPanel__content__items__right__bottom__right"
                  >
                    19:35:00
                    <!-- {{ util.utc2beijing(item.currentTime).split(" ")[1] }} -->
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
import mailListSearch from "../search/search.vue";
import storage from "../../../utils/storage";
import mailListBanner from "../mailListBanner.vue";
const userInfo = storage.getItem("userInfo");
const router = useRouter();
const mailListPatientIcon = [
  {
    icon: "&#xe65d;",
    text: "邀请患者",
  },
  {
    icon: "&#xe65c;",
    text: "所有患者",
  },
  {
    icon: "&#xe606;",
    text: "患者管理",
  },
  {
    icon: "&#xe633;",
    text: "群发助手",
  },
  {
    icon: "&#xe614;",
    text: "患教中心",
  },
  {
    icon: "&#xe6dd;",
    text: "问诊表",
  },
  {
    icon: "&#xe623;",
    text: "日程提醒",
  },
  {
    icon: "&#xe6dd;",
    text: "群发助手",
  },
];
const patientLinkManItem = ref([]);
patientLinkManItem.value = userInfo?.customs;
function toChat(name) {
  router.push(`/mailList/chat/${name}`);
}
</script>
<style lang="scss" scoped>
.container {
  &__content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    &__banner {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      padding: 20rem 7rem;
      background-color: #fff;
      &__items {
        width: 80rem;
        height: 64rem;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        margin: 18rem 8rem;
        &__icon {
          font-size: 35rem;
          color: #691fff;
          margin: 10rem 0;
        }
        &__content {
          font-size: 16rem;
        }
      }
    }
    &__message {
      display: flex;
      justify-content: start;
      flex-wrap: wrap;
      &__title {
        width: 414rem;
        font-size: 14rem;
        margin: 10rem 0;
      }
      &__msgPanel {
        width: 414rem;
        background-color: #fff;
        &__header {
          display: flex;
          justify-content: start;
          padding: 10rem;
          &__one {
            width: 60rem;
            height: 30rem;
            font-size: 13rem;
            text-align: center;
            line-height: 32rem;
            margin: 0 5rem;
          }
          &__two {
            width: 60rem;
            height: 30rem;
            font-size: 13rem;
            text-align: center;
            line-height: 32rem;
            margin: 0 5rem;
          }
          &__three {
            width: 60rem;
            height: 30rem;
            font-size: 13rem;
            text-align: center;
            line-height: 32rem;
            margin: 0 5rem;
          }
          & .active {
            background-color: #6481da;
            border-radius: 5rem;
            color: #fff;
            font-weight: bold;
            font-size: 14rem;
          }
        }
        &__content {
          &__items {
            display: flex;
            padding: 10rem;
            margin-bottom: 20rem;
            &__img {
              width: 68rem;
              height: 68rem;
              border-radius: 50%;
            }
            &__right {
              display: flex;
              flex-direction: column;
              justify-content: space-around;
              width: 300rem;
              margin-left: 20rem;
              &__top {
                font-size: 16rem;
                font-weight: bold;
                & span.type {
                  font-size: 14rem;
                  color: #919191;
                  margin-left: 10rem;
                }
              }
              &__bottom {
                width: 330rem;
                font-size: 14rem;
                color: #919191;
                display: flex;
                justify-content: space-between;
                &__left {
                  width: 180rem;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                }
                &__right {
                  width: 120rem;
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>
